<template>
  <div class="father">
    {{ name }}
    <hr />
    {{ isAdmin }}
    <hr />
    {{ age }}
    <hr />
    {{ cars }}
    <hr />
    {{ firend }}
    <hr />
    子组件:{{ sondata }}
    <!-- 父传子   父组件的数据作为一个属性进行传递    -->
    <Son
      :name="name"
      :getSon="getSon"
      :isAdmin="isAdmin"
      :age="age"
      :cars="cars"
      :firend="firend"
      @web44="web44"
    ></Son>
  </div>
</template>

<script>
import Son from "./Son.vue";
export default {
  components: {
    Son,
  },
  data() {
    return {
      name: "小明",
      isAdmin: true,
      age: 28,
      cars: ["奔驰", "奥迪"],
      firend: {
        name: "寒梅",
      },
      sondata: "",
    };
  },
  methods: {
    getSon(value) {
      console.log("我被调用了....s", value);
      this.sondata = value;
    },
    web44(value) {
        console.log("自定义事件触发了.....",value);
        this.sondata = value;
    }
  },
};
</script>

<style scoped>
.father {
  width: 500px;
  height: 500px;
  background-color: red;
}
</style>
